package info.wsmlby.android.svndroid;

import java.io.File;

import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNRevision;

import info.wsmlby.android.compat.ActionBarActivity;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class SvndroidActivity extends ActionBarActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        SVNClientManager clientManager=SVNClientManager.newInstance();
        TextView tv=(TextView) findViewById(R.id.debug);
        SVNDepth sd=SVNDepth.INFINITY;
        SVNURL url;
		try {
			url = SVNURL.parseURIEncoded("http://svn-for-android.googlecode.com/svn/trunk/");
			tv.setText(url.getHost());
			clientManager.getUpdateClient().doCheckout(url, new File("/sdcard/svnandroid"), SVNRevision.HEAD, SVNRevision.BASE, sd, true);
		} catch (SVNException e) {
			
			tv.setText(e.toString());
		}
    }
}